{
GtkWindow *window = user_data;
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- GList *l = priv->foci, *cur;
+ GList *l = priv->foci;
while (l)
{
+ GList *next;
GtkPointerFocus *focus = l->data;
- cur = l;
- focus = cur->data;
- l = cur->next;
+ next = l->next;
if (focus->device == device)
{
- priv->foci = g_list_delete_link (priv->foci, cur);
+ priv->foci = g_list_delete_link (priv->foci, l);
gtk_pointer_focus_unref (focus);
}
+
+ l = next;
}
}
GtkWidget *widget)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- GList *l = priv->foci, *cur;
+ GList *l = priv->foci;
while (l)
{
+ GList *next;
+
GtkPointerFocus *focus = l->data;
- cur = l;
- focus = cur->data;
- l = cur->next;
+ next = l->next;
gtk_pointer_focus_ref (focus);
if (GTK_WIDGET (focus->toplevel) == widget)
{
/* Unmapping the toplevel, remove pointer focus */
- priv->foci = g_list_remove_link (priv->foci, cur);
+ priv->foci = g_list_remove_link (priv->foci, l);
gtk_pointer_focus_unref (focus);
- g_list_free (cur);
+ g_list_free (l);
}
else if (focus->target == widget ||
gtk_widget_is_ancestor (focus->target, widget))
}
gtk_pointer_focus_unref (focus);
+
+ l = next;
}
}
GtkWidget *grab_widget)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- GList *l = priv->foci, *cur;
+ GList *l = priv->foci;
while (l)
{
GtkPointerFocus *focus = l->data;
- cur = l;
- focus = cur->data;
- l = cur->next;
+ l = l->next;
if (focus->toplevel != window)
continue;